//
//  RouterNode.swift
//  Common
//
//  Created by yuyang on 2021/11/23.
//

import UIKit

@objc public enum RouterType: Int {
    case nativePage = 0
    case flutterPage
}

public typealias RouterHandler = (_ name: String, _ params: [String: Any]?, _ options: [String: Any]?) -> UIViewController & RouterRegisterProtocol

public class RouterNode: NSObject {
    @objc public var name: String
    @objc public var pageType: RouterType
    @objc public var pageHandler: RouterHandler?
    var isFlutter: Bool {
        return pageType == .flutterPage
    }

    @objc public init(name: String, pageType: RouterType, pageHandler: RouterHandler? = nil) {
        self.name = name
        self.pageType = pageType
        self.pageHandler = pageHandler
    }
}
